<!DOCTYPE html>
<html lang="en">

<!-- Head tag -->
<head><meta name="generator" content="Hexo 3.8.0">

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!--Description-->

    

    
        <meta name="description" content="一、smhd(Sound Media Header Box)看数据：1234567800 00 00 10 73 6D 68 64 00 00 00 00 00 00 00 00 ; ....smhd........==================  解析  ==================">
    

    <!--Author-->
    
        <meta name="author" content="Cyrus">
    

    <!--Open Graph Title-->
    
        <meta property="og:title" content="MP4格式解析六 smhd/vmhd/dinf">
    

    <!--Open Graph Description-->
    
        <meta property="og:description" content="一、smhd(Sound Media Header Box)看数据：1234567800 00 00 10 73 6D 68 64 00 00 00 00 00 00 00 00 ; ....smhd........==================  解析  ==================">
    

    <!--Open Graph Site Name-->
        <meta property="og:site_name" content="Cyrus的技术空间">

    <!--Type page-->
    
        <meta property="og:type" content="article">
    

    <!--Page Cover-->
    
    
        <meta property="og:image" content="http://cyrus_huang.gitee.io/bloghttp://www.codeblocq.com/assets/projects/hexo-theme-clean-blog/img/home-bg.jpg">
    

        <meta name="twitter:card" content="summary_large_image">

    

    
        <meta name="twitter:image" content="http://cyrus_huang.gitee.io/bloghttp://www.codeblocq.com/assets/projects/hexo-theme-clean-blog/img/home-bg.jpg">
    

    <!-- Title -->
    
    <title>MP4格式解析六 smhd/vmhd/dinf - Cyrus的技术空间</title>

    <!-- Bootstrap Core CSS -->
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link rel="stylesheet" href="/blog/css/style.css">

    <!-- Custom Fonts -->
    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Gallery -->
    <link href="//cdnjs.cloudflare.com/ajax/libs/featherlight/1.3.5/featherlight.min.css" type="text/css" rel="stylesheet">

    <!-- Google Analytics -->
    


    <!-- favicon -->
    

</head>


<body>

    <!-- Menu -->
    <!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header page-scroll">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/blog/">Cyrus的技术空间</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                
                    <li>
                        <a href="/blog/">
                            
                                Home
                            
                        </a>
                    </li>
                
                    <li>
                        <a href="/blog/archives">
                            
                                Archives
                            
                        </a>
                    </li>
                
                    <li>
                        <a href="/blog/tags">
                            
                                Tags
                            
                        </a>
                    </li>
                
                    <li>
                        <a href="/blog/categories">
                            
                                Categories
                            
                        </a>
                    </li>
                
                    <li>
                        <a href="https://github.com/klugjo/hexo-theme-clean-blog">
                            
                                <i class="fa fa-github fa-stack-2x"></i>
                            
                        </a>
                    </li>
                
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>

    <!-- Main Content -->
    <!-- Page Header -->
<!-- Set your background image for this header in your post front-matter: cover -->

<header class="intro-header" style="background-image: url('http://www.codeblocq.com/assets/projects/hexo-theme-clean-blog/img/home-bg.jpg')">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <div class="post-heading">
                    <h1>MP4格式解析六 smhd/vmhd/dinf</h1>
                    
                    <span class="meta">
                        <!-- Date and Author -->
                        
                            Posted by Cyrus on
                        
                        
                            2019-08-15
                        
                    </span>
                </div>
            </div>
        </div>
    </div>
</header>

<!-- Post Content -->
<article>
    <div class="container">
        <div class="row">

            <!-- Tags and categories -->
           
                <div class="col-lg-4 col-lg-offset-2 col-md-5 col-md-offset-1 post-tags">
                    
                        


<a href="/blog/tags/MP4/">#MP4</a>


                    
                </div>
                <div class="col-lg-4 col-md-5 post-categories">
                    
                        

<a href="/blog/categories/音视频/">音视频</a>

                    
                </div>
            

            <!-- Gallery -->
            

            <!-- Post Main Content -->
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <h3 id="一、smhd-Sound-Media-Header-Box"><a href="#一、smhd-Sound-Media-Header-Box" class="headerlink" title="一、smhd(Sound Media Header Box)"></a>一、smhd(Sound Media Header Box)</h3><p><img src="http://cyrus_huang.gitee.io/blog/2019/08/15/MP4格式解析六-smhd-vmhd-dinf/smhd_1.png" alt=""><br>看数据：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">00 00 00 10 73 6D 68 64 00 00 00 00 00 00 00 00 ; ....smhd........</span><br><span class="line"></span><br><span class="line">==================  解析  ===================</span><br><span class="line">00 00 00 10: size 16</span><br><span class="line">73 6D 68 64: smhd</span><br><span class="line">00 00 00 00: version flag都是0</span><br><span class="line">00 00 ： balance 一个16位整数，指定此声音媒体的声音平衡。声音平衡是控制计算机两个扬声器之间混音的设置。该字段通常设置为0。平衡值表示为16位定点数，范围从-1.0到+1.0。高阶8位包含值的整数部分;低8位包含小数部分。负值使平衡器向左扬声器加权;正值强调正确的渠道。将天平设置为0对应于中性设置。</span><br><span class="line">00 00 : 保留</span><br></pre></td></tr></table></figure></p>
<h3 id="二、vmhd-Video-Media-Header-Box"><a href="#二、vmhd-Video-Media-Header-Box" class="headerlink" title="二、vmhd(Video Media Header Box)"></a>二、vmhd(Video Media Header Box)</h3><p><img src="http://cyrus_huang.gitee.io/blog/2019/08/15/MP4格式解析六-smhd-vmhd-dinf/vmhd_1.png" alt=""><br>看数据:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">00 00 00 14 76 6D 68 64 00 00 00 01 00 00 00 00 ; ....vmhd........</span><br><span class="line">00 00 00 00                                     ; ....</span><br><span class="line"></span><br><span class="line">==================  解析  ===================</span><br><span class="line">00 00 00 14: size 20</span><br><span class="line">76 6D 68 64: vmhd</span><br><span class="line">00 00 00 01: version = 0,  flag 默认1</span><br><span class="line">00 00: Graphics mode 0,直接拷贝原始图片</span><br><span class="line">00 00 00 00 00 00：Opcolor 三个16位值，用于指定图形模式字段中指示的传输模式操作的红色，绿色和蓝色。</span><br></pre></td></tr></table></figure></p>
<p><img src="http://cyrus_huang.gitee.io/blog/2019/08/15/MP4格式解析六-smhd-vmhd-dinf/vmhd_2.png" alt=""></p>
<h3 id="三、dinf-Data-Information-Box"><a href="#三、dinf-Data-Information-Box" class="headerlink" title="三、dinf(Data Information Box)"></a>三、dinf(Data Information Box)</h3><p><img src="http://cyrus_huang.gitee.io/blog/2019/08/15/MP4格式解析六-smhd-vmhd-dinf/dinf_1.png" alt=""><br>看数据:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">00 00 00 24 64 69 6E 66 00 00 00 1C 64 72 65 66 ; ...$dinf....dref</span><br><span class="line">00 00 00 00 00 00 00 01 00 00 00 0C 75 72 6C 20 ; ............url </span><br><span class="line">00 00 00 01                                     ; ....</span><br><span class="line"></span><br><span class="line">==================  解析  ===================</span><br><span class="line">00 00 00 24: size 36</span><br><span class="line">64 69 6E 66: dinf</span><br><span class="line">00 00 00 1C: size 28</span><br><span class="line">64 72 65 66: dref</span><br><span class="line">00 00 00 00: version flag 均为0</span><br><span class="line">00 00 00 01：Entry count 1</span><br><span class="line">00 00 00 0C 75 72 6C 20 00 00 00 01： entry data</span><br></pre></td></tr></table></figure></p>
<p>entry结构图：<br><img src="http://cyrus_huang.gitee.io/blog/2019/08/15/MP4格式解析六-smhd-vmhd-dinf/dinf_2.png" alt=""><br>数据：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">00 00 00 0C 75 72 6C 20 00 00 00 01</span><br><span class="line"></span><br><span class="line">==================  解析  ===================</span><br><span class="line">00 00 00 0C： size 12</span><br><span class="line">75 72 6C 20: type &apos;url &apos;</span><br><span class="line">00 00 00 01: version 0, flag 1</span><br></pre></td></tr></table></figure></p>
<p>entry type类型说明：<br><img src="http://cyrus_huang.gitee.io/blog/2019/08/15/MP4格式解析六-smhd-vmhd-dinf/dinf_3.png" alt=""></p>


                
            </div>

            <!-- Comments -->
            
                <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                    


                </div>
            
        </div>
    </div>
</article>

    <!-- Footer -->
    <hr>

<!-- Footer -->
<footer>
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <ul class="list-inline text-center">
                    

                    

                    
                        <li>
                            <a href="https://github.com/klugjo/hexo-theme-clean-blog" target="_blank">
                                <span class="fa-stack fa-lg">
                                    <i class="fa fa-circle fa-stack-2x"></i>
                                    <i class="fa fa-github fa-stack-1x fa-inverse"></i>
                                </span>
                            </a>
                        </li>
                    

                    

                    

                    
                </ul>
                <p class="copyright text-muted">&copy; 2020 Cyrus<br></p>
                <p class="copyright text-muted">Original Theme <a target="_blank" href="http://startbootstrap.com/template-overviews/clean-blog/">Clean Blog</a> from <a href="http://startbootstrap.com/" target="_blank">Start Bootstrap</a></p>
                <p class="copyright text-muted">Adapted for <a target="_blank" href="https://hexo.io/">Hexo</a> by <a href="http://www.codeblocq.com/" target="_blank">Jonathan Klughertz</a></p>
                <p class="copyright text-muted"><a href="http://www.beian.miit.gov.cn">粤ICP备18110122号-1</a></p>
            </div>
        </div>
    </div>
</footer>


    <!-- After footer scripts -->
    
<!-- jQuery -->
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>

<!-- Bootstrap -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

<!-- Gallery -->
<script src="//cdnjs.cloudflare.com/ajax/libs/featherlight/1.3.5/featherlight.min.js" type="text/javascript" charset="utf-8"></script>

<!-- Disqus Comments -->



</body>

</html>